package com.seventh.associationsystem.repository;

import com.seventh.associationsystem.bean.Association;
import com.seventh.associationsystem.bean.CreateApplication;
import com.seventh.associationsystem.bean.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface CreateApplicationRepository extends JpaRepository<CreateApplication, String>, JpaSpecificationExecutor<CreateApplication> {
    CreateApplication findByUid(String uid);

    Page<CreateApplication> findByUser(User user, Pageable pageable);

    Page<CreateApplication> findByAssociationIn(List<Association> associations, Pageable pageable);
}
